package main

import (
	"fmt"
	"gorm-study/src/pkg/student/models"
	"gorm-study/src/pkg/utils/dbutil"
)

func main() {
	var ages []int64
	result := dbutil.DB.Model(&models.Student{}).Distinct("age").Find(&ages) // 传指针

	fmt.Printf("result.RowsAffected：%v \n", result.RowsAffected)
	fmt.Printf("ages：%v \n", ages)
}
